<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>Transportation Service Type</title>
            </f:facet>
        </h:head>
        <h:body>



            <h:form id="form">
                <center>Transportation Service Type</center>
                <br/>
                <center>Name: <h:inputText value="#{uuu.TSTName}" />
                
                <p:commandButton  value="Edit Name" type="submit"  action="#{uuu.editName}" />
                </center>
                <br/>
                <p:dataTable id="tbl" var="att" editable="true" paginator="true" rows="10" value="#{uuu.TSattributeTypesModel}">
                    <p:ajax event="rowEdit" listener="#{uuu.onEdit}"/>
                    <p:ajax event="rowEditCancel" listener="#{uuu.onCancel}" />


                    <p:column headerText="Value" style="width:25%">
                        <p:cellEditor>
                            <f:facet name="output">
                                <h:outputText value="#{att.value}" />
                            </f:facet>
                            <f:facet name="input">
                                <p:inputText value="#{att.value}" style="width:100%"/>
                            </f:facet>
                        </p:cellEditor>
                    </p:column>


                    <p:column headerText="att name" style="width:24%"> 
                        <p:cellEditor>
                            <f:facet name="output">
                                <h:outputText value="#{att.attributeType.name}" />
                            </f:facet>
                            <f:facet name="input">
                                <h:selectOneMenu value="#{att.attributeType.name}" >
                                    <f:selectItems value="#{attributebean.attributeTypes}"
                                                   var="man"
                                                   itemLabel="#{man.name}"
                                                   itemValue="#{man.name}" />
                                </h:selectOneMenu>
                            </f:facet>
                        </p:cellEditor>
                    </p:column>


                    <p:column style="width:6%">
                        <p:rowEditor />
                    </p:column>


                </p:dataTable> 
            </h:form>
        </h:body>

    </f:view>
</html>

